VectorScript plug-ins combine regular VectorScript script code with a plug-in “wrapper,” an encoded header which defines the characteristics and behaviors of the plug-in. Information such as the category of the plug-in, properties which define how the plug-in is activated, or any other information needed by the plug-in to function within the VectorWorks application framework is included within the header which “wraps” the script.
A key feature of VectorScript plug-ins is their smooth integration into the VectorWorks product interface. VectorScript plug-in menu commands, tools, and objects work just like any built-in VectorWorks tool, object, or menu item. Like built-in menu commands, VectorScript menu commands can be set to require certain file conditions such as 2D/3D view orientation or a selected set of items in order to activate. When a menu command or tool item is selected, the script and any information needed by the plug-in is loaded into memory, and the plug-in script executes. VectorWorks uses information provided by the plug-in to provide the user interactions (such as constraints) and file environment for the menu command or tool to perform its defined actions. VectorScript tools, like their built-in counterparts, make use of the SmartCursor and other tool-centric VectorWorks features.
Plug-in objects have characteristics of both VectorWorks tools and VectorWorks symbols. Plug-in objects can be added to a VectorWorks tool palette and resemble tool items, but in use they will place instances of the object in the file much like the symbol tool places symbols in a file. Object scripts can also be invoked through events that occur in the file. Placed object instances can be modified with the Object Info palette to edit the parametric values that are used to define the object, and these changes will cause the script defining the object to execute for the object to redraw. Global file changes which force a regeneration of the file can also cause the scripts of objects placed in the file to execute. These characteristics give plug-in objects enormous flexibility in how they can be displayed within a file.
Plug-in objects can also be used in conjunction with the Resource Browser to create preconfigured object instances that need minimal editing after placement. Libraries of different object configurations based on a single plug-in object can be easily created and retrieved through the Resource Browser.
When VectorWorks is launched, it searches for any VectorScript plug-ins and registers the information necessary to activate and manage the plug-ins. Include files are searched for in the same folder where the associated plug-in is located.
The flexibility of the plug-in location provides an advantage when upgrading from a previous version of VectorWorks. Because third-party plug-ins can be stored in a folder separate from the application, they can easily be referenced when installing the upgrade. Copying the plug-ins folders to the current version’s folders, or referencing them with an alias or shortcut, is all that is required when upgrading.